package com.chixing.controller;

import com.chixing.service.IdempotentTokenService;
import com.chixing.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
@RequestMapping("idempotent")
public class AutoIdempotentController {
    @Autowired
    private IdempotentTokenService idempotentTokenService;

    @GetMapping("createToken")
    public Result createToken(){
        String token = idempotentTokenService.createToken();
        return Result.getSuccess(token);
    }
}
